<?php

namespace App\Models;

use App\Models\Base\WorkTicketTransfer as BaseWorkTicketTransfer;

/**
 * 
 *
 * @property int $id
 * @property int $work_ticket_id 工单id
 * @property int $from_work_user_id 转接前维护人员id
 * @property int $to_work_user_id 转接后维护人员id
 * @property string|null $remark 转接备注
 * @property int $status 状态|100:待接受,101:已接受,102:已拒绝
 * @property \Illuminate\Support\Carbon|null $accept_at 接受时间
 * @property \Illuminate\Support\Carbon|null $reject_at 拒绝时间
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read \App\Models\WorkUser|null $fromWorkUser
 * @property-read \App\Models\WorkUser|null $toWorkUser
 * @property-read \App\Models\WorkTicket|null $workTicket
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer query()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereAcceptAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereFromWorkUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereRejectAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereToWorkUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer whereWorkTicketId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer withTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketTransfer withoutTrashed()
 * @mixin \Eloquent
 */
class WorkTicketTransfer extends BaseWorkTicketTransfer
{
	protected $fillable = [
		self::WORK_TICKET_ID,
		self::FROM_WORK_USER_ID,
		self::TO_WORK_USER_ID,
		self::REMARK,
		self::STATUS,
		self::ACCEPT_AT,
		self::REJECT_AT
	];

	public function workTicket()
	{
		return $this->belongsTo(WorkTicket::class, self::WORK_TICKET_ID);
	}

	public function fromWorkUser()
	{
		return $this->belongsTo(WorkUser::class, self::FROM_WORK_USER_ID);
	}

	public function toWorkUser()
	{
		return $this->belongsTo(WorkUser::class, self::TO_WORK_USER_ID);
	}
}
